﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Init {
    import flash.events.*;
    import Engine.Init.*;
    import ZLocalization.*;

    public class LocalizationInit extends InitializationAction {

        public static const INIT_ID:String = "LocalizationInit";

        private var m_localeUrl:String = "";
        private var m_xml:XML;
        private var localeLoader:LocaleLoader;

        public function LocalizationInit(_arg1:String){
            super(INIT_ID);
            this.m_localeUrl = _arg1;
            GlobalEngine.zaspManager.trackTimingStart("LOCALE_INIT");
            _weight = 40;
        }
        override public function execute():void{
            var _local1:Boolean;
            if (this.m_localeUrl.indexOf(".xml.z") < 0){
                _local1 = false;
            };
            this.localeLoader = new LocaleLoader(this.m_localeUrl, this.onConfigXmlLoaded, _local1);
        }
        private function onConfigXmlLoaded():void{
            Global.localizer = this.localeLoader.localizer;
            Global.localizer.setAsGlobalInstance();
            dispatchEvent(new Event(Event.COMPLETE));
            GlobalEngine.zaspManager.trackTimingStop("LOCALE_INIT");
        }

    }
}//package Init 
